use tauri;
use crate::models::contact::Contact;
use crate::services::contact::ContactService;

#[tauri::command]
pub async fn list_contacts() -> Result<Vec<Contact>, String> {
    ContactService::list().await.map_err(|e| e.to_string())
}

#[tauri::command]
pub async fn add_contact(contact: Contact) -> Result<(), String> {
    ContactService::add(contact).await.map_err(|e| e.to_string())
}


